from django.db import models
from django.contrib.auth.models import User

class OrigWebGLModel(models.Model):
    gender = models.CharField(max_length = 1)
    webgl_id_ref = models.IntegerField()
    age = models.CharField(max_length = 3)
    file_location = models.CharField(max_length = 500)
    
    def __unicode__(self):
        return self.file_location
    
class WebGLModel(models.Model):
    gender = models.CharField(max_length = 1)
    age = models.CharField(max_length = 3)
    file_location = models.CharField(max_length = 500)
    
    def __unicode__(self):
        return self.file_location
    
class Interaction(models.Model):
    user_id_ref = models.IntegerField()
    webgl_id_refs = models.CharField(max_length = 150) #X
    num_images = models.IntegerField()                 
    case_info = models.CharField(max_length = 300)
    selections = models.CharField(max_length = 1000)   #X
    datetime = models.DateTimeField("date published")  #X
    milli = models.IntegerField()                    #X
    
    def __unicode__(self):
        return self.selections
    
    def ref_user(self):
        return User.objects.get(pk=self.user_id_ref)
